﻿<%@ Page Language="C#" MasterPageFile="~/Views/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">
        http://asp.net/mvc</a>.
        <div id="summits">
    <table>
        <%
            ArrayList list = (ArrayList)ViewData["mountains"];
            for (int i=0;i<list.Count;i++)
            {%>
        <tr>
            <td>
                <%=((ActionViewer.Models.MountainInfo)list[i]).name %>
            </td>
            <td>
                <%=((ActionViewer.Models.MountainInfo)list[i]).height%>
            </td>
            <td>
                <%using (Html.BeginForm("DeleteItem", "Home"))
                  {%>
                    <%=Html.Hidden("name", ((ActionViewer.Models.MountainInfo)list[i]).name)%>
                    <input type="submit" value="Delete" />
                <%} %>
            </td>
        </tr>
        <%}
        %>
    </table>   
    Page: <%=Html.PageLinks(2,3,i=>Url.Action("Index",new {page=i}))  %>   
    </div>
</asp:Content>
